package com.kodin.webview;

import android.annotation.SuppressLint;
import android.os.Bundle;
import android.view.View;

import androidx.appcompat.app.AppCompatActivity;

import com.blankj.utilcode.constant.PermissionConstants;
import com.blankj.utilcode.util.LogUtils;
import com.blankj.utilcode.util.PermissionUtils;
import com.blankj.utilcode.util.ToastUtils;

import java.util.List;

/**
 * uniapp页面
 */
public class MainActivity extends AppCompatActivity {
    private String TAG = "cmy_" + this.getClass().getSimpleName();

    @SuppressLint("SourceLockedOrientationActivity")
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main_layout);
        PermissionUtils.permission(PermissionConstants.STORAGE).callback(new PermissionUtils.FullCallback() {
            @Override
            public void onGranted(List<String> permissionsGranted) {
            }

            @Override
            public void onDenied(List<String> permissionsDeniedForever, List<String> permissionsDenied) {
                ToastUtils.showShort("需要相机和存储权限");
            }
        }).request();
    }

    public void gyQuan(View view) {
        TXWebViewActivity.startTxWeb(this, "192.168.8.131:8080");
    }

    public void yunTing(View view) {
        String cloudsHall = "http://192.168.8.130:8080/#/pages/tabbar/cloudsHall/CLoudsHall?token=";
        TXWebViewActivity.startTxWeb(this, cloudsHall);
    }

    public void netNull(View view) {
        TXWebViewActivity.startTxWeb(this, null);
    }

    @Override
    protected void onResume() {
        super.onResume();
        LogUtils.e(TAG);
    }

    @Override
    protected void onPause() {
        super.onPause();
        LogUtils.e(TAG);
    }

    @Override
    protected void onStop() {
        super.onStop();
        LogUtils.e(TAG);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        LogUtils.e(TAG);
    }
}
